home *** CD-ROM | disk | FTP | other *** search
- Path: nntp.teleport.com!sschaem
- From: sschaem@teleport.com (Stephan Schaem)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: TMapping again!
- Date: 27 Feb 1996 15:41:56 GMT
- Organization: Teleport - Portland's Public Access (503) 220-1016
- Distribution: world
- Message-ID: <4gv8o4$hft@maureen.teleport.com>
- References: <38232527@kone.fipnet.fi> <4gkrht$d5l@maureen.teleport.com> <38232665@kone.fipnet.fi>
- NNTP-Posting-Host: julie.teleport.com
- X-Newsreader: TIN [version 1.2 PL2]
-
- Jyrki Saarinen (jsaarinen@kone.fipnet.fi) wrote:
-
- : > a mul?.w is 27, a muls.l is 43
- : > a divs.l is 90
-
- : Max. 90.. How about if the low word is zero? I think the
- : amount of bits on influences the speed of a divide.
-
- I remember the 68000 taking -+10% for the div count... max was a
- few hundreds cycle I think :)
- But the mul cycle too can fluctuate, I will check on a 68030.
-
- : > -- what you do with muls.l is:
- : >
- : > setup
- : > move.l (a2,d0.w*4),d1 ;done upto 4 time per poly
- : >
- : > opp:
- : > ext.l d2
- : > muls.l d1,d2 ; 2+43 * upto 15time = 675
- : >
- : >
- : > -- with div:
- : >
- : > setup
- : > ext.l d0 ; done upto 4 time per poly
- : >
- : > opp:
- : > swap d2
- : > sub.w d2,d2
- : > divs.l d2,d0 ;4+2+90 * 15 = 1440
-
- : Yep, but the point is that my values are readily shifted
- : to high word, and if I want to use muls.l 1/x table with 16.16,
- : I have to clear the upper word, too.
-
- I think I added 2 cycle for that, the ext.l...
-
- : > You dont have to fall back to 15bit precision to gain the speed
- : > from mul VS div... using 15bit give you an extra 6.03 mcycle, or
- : > you could use mulu.w and adjust the sign?
-
- : Adjusting the sign .. naah..
-
- You can do ALOT in 90cycles :)
-
- : > Myself I will stick with 16:16 and muls.l on 68030 and under.
- : > a divs.l is ~2time slower then a muls.l and ~3.5 slower then a muls.w
- : > On a 68000 I would go with 15bit and muls + an add.l: 76 cycle... ouch
- : > but still less then a divs.l on a 030 ;) (To bad the 68000 mhz is so
- : > limited:)
-
- : A divide table would be the best in my case.. 512kB for a table.
- : Oh yes, muls.w 15bit table and the add.l dx,dx.. quite clever..
-
- I'm curently using a 4K table for slope, 32K table for projection.
- But thats still all in C, I'm not 100% sure how all this will
- actually turn out.
-
- : But I still dont get your point; the divides dont matter
- : very much in the frame rate..
-
- In the case of doom or so... complex pixel and huge polygon its
- so minimal it doesn't matter. But if you add polygonal player
- in that scene the polygon count jump.
-
- Stephan
-